home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 013 / dog001.arc / DOG.DOC next >
Encoding:
Text File  |  1986-05-01  |  21.3 KB  |  449 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                         ╔═══════════════════════════════════╗
  25.                         ║   Disk OrGanizer - Version 1.00   ║
  26.                         ║                                   ║
  27.                         ║       Soft GAMs Software          ║
  28.                         ║       (c) Copyright 1986          ║
  29.                         ║                                   ║
  30.                         ║       Three GAMs Software         ║
  31.                         ║       G. Allen Morris III         ║
  32.                         ║       1411 10th Avenue            ║
  33.                         ║       Oakland, CA  94606          ║
  34.                         ╟───────────────────────────────────╢
  35.                         ║        Mail may be left at        ║
  36.                         ║          Satorie Center           ║
  37.                         ║    FIDO #125/521 (ALLEN MORRIS)   ║
  38.                         ║           (415)647-8528           ║
  39.                         ╚═══════════════════════════════════╝
  40.  
  41.  
  42.                                   TABLE OF CONTENTS
  43.  
  44.           INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . .    1
  45.  
  46.           BACKGROUND PROGRAMS  . . . . . . . . . . . . . . . . . . . .    1
  47.  
  48.           LIMITS . . . . . . . . . . . . . . . . . . . . . . . . . . .    2
  49.  
  50.           ORGANIZING YOUR DISK . . . . . . . . . . . . . . . . . . . .    2
  51.  
  52.           RUNNING Disk OrGanizer THE FIRST TIME  . . . . . . . . . . .    4
  53.  
  54.           ADVANCED FEATURES  . . . . . . . . . . . . . . . . . . . . .    4
  55.  
  56.           COMMANDS . . . . . . . . . . . . . . . . . . . . . . . . . .    7
  57.  
  58.  
  59.  
  60.  
  61.                                     INTRODUCTION
  62.  
  63.           This program  was written to help people to speed up disk access,
  64.           it will be of most help to people that are using large data files
  65.           or programs that use overlays.
  66.           What the  program does  it allow you to de-fragment and order the
  67.           files and sub-directories on a disk.  The program also compresses
  68.           the directories which will speed up finding files in directories.
  69.           Depending on the way the data on your disks is being accessed you
  70.           may or may not notice a large difference in performance.
  71.  
  72.  
  73.                                  BACKGROUND PROGRAMS
  74.  
  75.           You can not have BACKGROUND programs that read or write  the disk
  76.           that you are Organizing. The reason for this is that DiskOrGanizer
  77.           writes directly to the disk and does not use DOS, so DOS will not
  78.           know were  to read  or write  data to  or from.  Which will cause
  79.           them to read garbage and to  write to  Clusters that  are used by
  80.           other programs.   If writes  occur large  amounts of  data can be
  81.           lost as the directories  can be  over written.   I am  working on
  82.           ways around  this problem, but I have not come up with a good one
  83.           yet.
  84.  
  85.  
  86.                                       DATA LOSS
  87.  
  88.           In normal operation there should be no data loss, with the exception
  89.           of write errors that are not detected by MSDOS.  This is the same
  90.           verification that DOS uses to verify  data that  is Copied. Disk-
  91.           OrGanizer has as switch that will allow it to run without verifying
  92.           data and it will run faster if it does not  verify the  data, But
  93.           there is  a greater chance of data loss. I would suggest that you
  94.           use the verify on floppy disks. On hard disks it is up  to you, I
  95.           have not  had a  write error on my hard disk after running it for
  96.           over a year.
  97.  
  98.  
  99.                                     POWER FAILURE
  100.  
  101.           In a power failure some problems can occur,  but they  can all be
  102.           fixed buy running CHKDSK and DiskOrGanizer.
  103.  
  104.           If a  file is  being moved  there is  only a problem if the power
  105.           failure occurs between the time that the directory is written and
  106.           the FAT is written, CHKDSK can recover all of the data as it will
  107.           be in two places on the disk.  To recover from this run 'CHKDSK /f'
  108.           you will see the following:
  109.  
  110.           1 lost cluster found in 1 chains.
  111.           Convert lost chains to files  (Y/N)?  (Answer No)
  112.                nnnn bytes disk space freed.
  113.  
  114.  
  115.  
  116.           You will then get the rest of the information from CHKDSK.
  117.  
  118.           If Disk OrGanizer was moving a sub-directory then you may also see
  119.           the message:
  120.           d:\subdir\sibling
  121.                Invalid sub-directory entry.
  122.  
  123.           This message is generated if the  power failure  occurred between
  124.           writing the sub-directory and it's sibling.  You may get messages
  125.           stating that there are more than one invalid sub-directory entries.
  126.           This is normal as long as they all are sibling of the same parent.
  127.  
  128.           There is only one other problem that can occur and that is if the
  129.           power failure occurs between the time that the first FAT is written
  130.           and the  second FAT  is written.   If this  happens the next time
  131.           that you run DiskOrGanizer you will see the message:
  132.  
  133.           FATs do not compare.  (If you have not just run CHKDSK answer No)
  134.           Would you like to fix FAT2? 
  135.  
  136.           Answering Yes to this question will write FAT1 into FAT2  and you
  137.           will be off and running.
  138.  
  139.           NOTE:
  140.           It is  always important  to run  CHKDSK after  a power failure to
  141.           correct any problems that may have occurred wether you were running
  142.           DiskOrGanizer or not.
  143.  
  144.  
  145.                                        LIMITS
  146.  
  147.           Because the  FAT and  directories are  read into memory there are
  148.           some limits to there sizes.
  149.  
  150.           There must be less than 32000 clusters on the disk.   If you have
  151.           a disk  with more than 32000 clusters write me or leave a message
  152.           on the bulletin board listed below and we can talk  about getting
  153.           you a special version of DiskOrGanizer.
  154.  
  155.           There also cannot be more than 2000 files any one directory.  Again
  156.           if you have this problem I can probably modify the program to run
  157.           on your disk.
  158.  
  159.           The only  other limit is how much memory your computer has limits
  160.           the total number of files that can be  on the  entire disk.  Each
  161.           directory entry  takes about 34 bytes so if you have 300k of free
  162.           memory you will be limited to about 8000  total files  before you
  163.           run out of memory.
  164.  
  165.  
  166.                                 ORGANIZING YOUR DISK
  167.  
  168.           It is  hard to  say what is the best way to organize a disk as it
  169.  
  170.  
  171.           will be different for each application.  But I will try to describe
  172.           some of the main considerations here.
  173.  
  174.           First we  need a  slight understanding  of how  MSDOS handles the
  175.           files on a disk.
  176.  
  177.           Opening a file: When a file is opened DOS  creates a  FILE handle
  178.           for the  file.  The  number of file handles that can be opened is
  179.           controlled by the FILES= command in your CONFIG.SYS file.  In the
  180.           FILE handle  DOS saves  information about were the data is stored
  181.           on the disk.  This involves reading the directory  or directories
  182.           if the file is not in the current directory and the FAT.  
  183.  
  184.           Reading from  a file: When  data is read from a file DOS looks at
  185.           the FILE handle to find the data and then reads the data into one
  186.           of the  buffers that  were defined in the BUFFERS= command in the
  187.           CONFIG.SYS file.  If this data is read again it will  be read out
  188.           of this buffer and not off the disk.  
  189.  
  190.           Writing to  a file: When  data is  written to a file DOS looks to
  191.           see if the data from the location that it is going to write to is
  192.           in a  buffer, if it is DOS over writes the buffer and then writes
  193.           the data to the disk.  If the data  was not  already in  a buffer
  194.           DOS will put the data into a buffer and then write it to the disk
  195.           if this data is then read DOS will get the data from  this buffer
  196.           rather than the disk.
  197.  
  198.           Closing a file: When a file that has been written to is closed by
  199.           DOS uses the data in the  FILE handle  which was  updated by each
  200.           write to update the directory entry for the file and update the FAT.
  201.  
  202.           We can see from this that the FAT and directory is only used when
  203.           a file is opened or closed.  Because of  this it  is not terribly
  204.           important to  keep the  files on  the outer  tracks (close to the
  205.           FAT) unless the file is opened and closed often.
  206.  
  207.           So what files are opened and closed a  lot? Well Batch  files are
  208.           opened and closed between each operation.  EXE and COM files that
  209.           are simple utilities such as ASK.COM  are also  opened and closed
  210.           often.    Overlay files  are also opened and closed often, QMODEM
  211.           would run faster if it's overlay files were on the outer tracks.
  212.           Larger EXE and COM files should come after these as  they are not
  213.           opened and closed as often.
  214.  
  215.           All of these files almost never change in size and therefore will
  216.           not become fragmented this  also makes  them good  candidates for
  217.           being put on the inner tracks of the disk.  
  218.  
  219.           Many data  files are opened once read many times and then closed.
  220.           Most of the time on these files is spend reading the data  and if
  221.           there are  not enough  BUFFERS to  hold the  entire file the disk
  222.           will have to be read repeatedly.  So the location of  these files
  223.           is not  very important  but it  is important that the data in the
  224.           file is close together.  Also if the file  is used  by a database
  225.  
  226.  
  227.           manager and is indexed by another file we would want both of these
  228.           files to be close  together.  In  some applications  there may be
  229.           many files  that are  open at the same time and we would want all
  230.           of them to be close together.
  231.  
  232.           The last type of file I can think of is a data file that is written
  233.           to often.   These files  change size and become fragmented.   Yet
  234.           many of these files have the same needs as the previous type.  If
  235.           these files  are placed  last Disk  OrGanizer will be able to de-
  236.           fragment them faster and therefore they should be  placed last on
  237.           the disk.  
  238.  
  239.  
  240.                         RUNNING Disk OrGanizer THE FIRST TIME
  241.  
  242.           Disk OrGanizer has been tested with MSDOS 2.10 and MSDOS 3.00.  It
  243.           has also been used on disks as big as 20 Megabytes.
  244.           There is extensive testing done to make sure that the disk can be
  245.           read and written and that the FAT and that directories are in good
  246.           repair. It is very unlikely that  Disk  OrGanizer  will  hurt the
  247.           data on  your disk, but it is always a good idea to have the data
  248.           on a hard disk on BACKUP disks or tape and to have a copy of data
  249.           on floppy disks.
  250.  
  251.           If the  file ORDER.DOG  is not found in the root directory of the
  252.           disk that you specify Disk Organizer will prompt  you for  all of
  253.           the information that it needs.  To organize a disk other that the
  254.           current drive use the command DOG d:, 'd' being the  drive letter
  255.           of the drive you wish to organize.
  256.  
  257.  
  258.                                   ADVANCED FEATURES
  259.  
  260.           There are  several ways that Disk OrGanizer can Optimize the data
  261.           on your disk. They are as follows:
  262.  
  263.           Fast Order.
  264.                This forces all un-fragmented  files to  stay were  they are
  265.                and then attempts to put fragmented files into free areas that
  266.                are left.  If a fragmented file will not fit into any of the
  267.                free areas it is then stored in two or more of the free areas.
  268.  
  269.           Directory order.
  270.                This puts the files onto the disk in the order that they are
  271.                in the  directories. You can  use the  TREE command to get a
  272.                ruff idea of what this looks like.
  273.  
  274.           Packed order.
  275.                This leaves the files in the same order as it  finds them on
  276.                the disk. It  will leave only one area of free disk space at
  277.                the outer tracks of the disk.  
  278.  
  279.           Fragmented order.
  280.  
  281.  
  282.                This will put all of the  files that  are not  fragmented on
  283.                the disk first and will then put the fragmented files on the
  284.                disk.  Using this function will slowly put all  of the files
  285.                that change  size on  the outer  tracks of the disk. You can
  286.                use this  function to  get a  similar effect  to the special
  287.                order function  but it will take several passes over several
  288.                days.
  289.  
  290.  
  291.           Ok so you want you files to be just so.  In order to do  this you
  292.           will need  to make  a file that lists the files in the order that
  293.           you want them on  the disk. Files  need to  have there  full path
  294.           names included. Sub-directories are treated as files and not as a
  295.           wild card pointing to all of the files in the sub-directory.
  296.           There is also a switch that can be included to tell Disk OrGanizer
  297.           where to leave free space.
  298.           The utility  DOGMAKE is  included to help you make this file. You
  299.           may also need a text editor that has a non-document mode to sort,
  300.           delete or add to this file.
  301.           The default name for this file is "ORDER.DOG" and it should be in
  302.           the ROOT directory of the disk being worked  on, or  you can also
  303.           give Disk OrGanizer the name and path of the file you wish to use.
  304.  
  305.           Below is a sample of what this file should look like.
  306.  
  307.           [noverify]
  308.           [fast]                   ;This tells Disk OrGanizer how to handle
  309.                                    ;any unnamed files or sub-directories.
  310.           [FORCE]
  311.           \COMMAND.COM             ;This fill force  COMMAND.COM  to remain
  312.                                    ;were  it  is.  This command should come
  313.                                    ;before any other files  are named. This
  314.                                    ;command will not be of much use to most
  315.                                    ;users.
  316.           [ENDFORCE]               ;This tell DiskOrGanizer that the following
  317.                                    ;file should be placed in order.
  318.           \AUTOEXEC.BAT
  319.           \PROG1.OVL
  320.           \PROG2.OVL
  321.           \SUBDIR_A\PROG1.OVL      ;This is different than \PROG1.OVL
  322.           \SUBDIR_A
  323.           \SUBDIR_B
  324.           [HIGH]                   ;This tell  Disk OrGanizer that the rest
  325.                                    ;of the files should  be  placed  on the
  326.                                    ;inner tracks.
  327.           \CONFIG.SYS              ;This will  be the last file on the disk
  328.                                    ;and its last  cluster  will  occupy the
  329.                                    ;last cluster on the disk.
  330.           \ORDER.DOG               ;You can include this file.
  331.           \ORDER.BAK               ;This  will  be  the third from the last
  332.                                    ;file on the disk.
  333.  
  334.           As you can see it will take some work to make this file. The DOGMAKE
  335.           utility can help you make this file. Basically DOGMAKE is a WHEREIS
  336.  
  337.  
  338.           program. The difference is that it  outputs  the  full  path name
  339.           along with the file or sub-directory name.  it output goes to the
  340.           standard output device.
  341.           So you can either run DOGMAKE *.* and then use your text editor to
  342.           sort the data or you can run DOGMAKE something like this:
  343.  
  344.           DOGMAKE command.com > \order.dog
  345.           DOGMAKE autoexec.bat >> \order.dog
  346.           DOGMAKE *.ovl >> \order.dog
  347.           DOGMAKE SUBDIR* >> \order.dog
  348.           DOGMAKE CONFIG.SYS >> \order.dog
  349.           DOGMAKE ORDER.DOG >> \order.dog
  350.  
  351.           This would give you a file resembling the ORDER.DOG sample above.
  352.  
  353.           After you have gotten ORDER.DOG made you can run Disk OrGanizer.
  354.  
  355.           Use the following command:
  356.  
  357.                DOG
  358.  
  359.           If you want to use a different filename than "\ORDER.DOG" you can
  360.           use:
  361.  
  362.                DOG path\filename.ext
  363.  
  364.  
  365.  
  366.                                       COMMANDS
  367.  
  368.                DOG [d:] [path\filename.ext] [/FA|/FR|/PA|/DI] [/NV]
  369.  
  370.           [FAST]         /FA  This forces  all un-fragmented  files to stay
  371.                               were they  are and then attempts to put frag-
  372.                               mented files into free  areas that  are left.
  373.                               If a fragmented file will not fit into any of
  374.                               the free areas it  is then  stored in  two or
  375.                               more of the free areas. 
  376.  
  377.           [FRAGMENTED]   /FR  This will  put all  of the files that are not
  378.                               fragmented on the disk  first  and  will then
  379.                               put the  fragmented files on the disk.  Using
  380.                               this function will slowly put all of the files
  381.                               that change  size on  the outer tracks of the
  382.                               disk. You can use this function to get a similar
  383.                               effect to  the special  order function but it
  384.                               will take several passes over several days.
  385.  
  386.           [PACKED]       /PA  This leaves the files in the same order as it
  387.                               finds  them  on  the disk. It will leave only
  388.                               one area of free disk space at the outer tracks
  389.                               of the disk.  
  390.  
  391.           [DIRECTORY]    /DI  This puts the files onto the disk in the order
  392.                               that they are in the directories. You can use
  393.                               the TREE  command to  get a ruff idea of what
  394.                               this looks like.
  395.  
  396.           [NOVERIFY]     /NV  This tells DiskOrGanizer to turn off the MSDOS
  397.                               verify  switch.    DiskOrGanizer turns on the
  398.                               verify switch unless told not too.
  399.  
  400.           [HIGH]              This tells DiskOrganizer to  put the  rest of
  401.                               the files in ORDER.DOG on the inner tracks of
  402.                               the disk.
  403.  
  404.           [FREE nn]           This tells DiskOrganizer to leave nn clusters
  405.                               of  free  space.    There must be enough free
  406.                               area on the disk or the command will be ignored.
  407.  
  408.           [FORCE]             FORCE allows  you to keep Disk OrGanizer from
  409.                               doing any work on a particular  file or group
  410.                               of files.  It must be followed by an ENDFORCE.
  411.  
  412.           [ENDFORCE]          This  tells  Disk  OrGanizer to stop FORCEing
  413.                               files.
  414.  
  415.  
  416.  
  417.  
  418.                                         INDEX
  419.  
  420.           [DIRECTORY]  . . . . . . . . . . . . . . . . . . . . . . . . .  7
  421.           [ENDFORCE] . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  422.           [FAST] . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  423.           [FORCE]  . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  424.           [FRAGMENTED] . . . . . . . . . . . . . . . . . . . . . . . . .  7
  425.           [FREE nn]  . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  426.           [HIGH] . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  427.           [NOVERIFY] . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  428.           [PACKED] . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  429.           /DI  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  430.           /FA  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  431.           /FR  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  432.           /NV  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  433.           /PA  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  434.           BACKGROUND PROGRAMS  . . . . . . . . . . . . . . . . . . . . .  1
  435.           DATA LOSS  . . . . . . . . . . . . . . . . . . . . . . . . . .  1
  436.           DOGMAKE  . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  437.           DOS I/O
  438.                Closing a file  . . . . . . . . . . . . . . . . . . . . .  3
  439.                Opening a file  . . . . . . . . . . . . . . . . . . . . .  3
  440.                Reading from a file . . . . . . . . . . . . . . . . . . .  3
  441.                Writing to a file . . . . . . . . . . . . . . . . . . . .  3
  442.           INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . .  1
  443.           LIMITS . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  444.           ORDER.DOG  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  445.           ORGANIZING YOUR DISK . . . . . . . . . . . . . . . . . . . . .  2
  446.           POWER FAILURE  . . . . . . . . . . . . . . . . . . . . . . . .  1
  447.           RUNNING Disk OrGanizer THE FIRST TIME    . . . . . . . . . . .  4
  448.  
  449.